Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VAD + Non-streaming ASR example for JavaScript API. #1170

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

csukuangfj
Copy link
Collaborator

It also fixes the following error

undefined:1
{"text": " But whenever I complain, my mother would just give me one of those looks and she'd say, "This is no picnic for me, either, Buster."", "tim
estamps": [], "tokens":[" But", " whenever", " I", " complain", ",", " my", " mother", " would", " just", " give", " me", " one", " of", " those", "
looks", " and", " she", "'d", " say", ",", " "", "This", " is", " no", " picnic", " for", " me", ",", " either", ",", " Buster", ".""], "words": []}
                                                                                                    ^

SyntaxError: Expected ',' or '}' after property value in JSON at position 100 (line 1 column 101)
    at JSON.parse (<anonymous>)
    at OfflineRecognizer.getResult (/Users/fangjun/open-source/sherpa-onnx/nodejs-addon-examples/node_modules/sherpa-onnx-node/non-streaming-asr.js:3
4:17)
    at Object.<anonymous> (/Users/fangjun/open-source/sherpa-onnx/nodejs-addon-examples/test_vad_with_non_streaming_asr_whisper.js:88:26)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)

When text or tokens contains " (double quotes), we need to skip it when converting to a json string.

@csukuangfj csukuangfj merged commit 994c3e7 into k2-fsa:master Jul 26, 2024
187 of 194 checks passed
@csukuangfj csukuangfj deleted the js-vad-asr branch July 26, 2024 04:42
@csukuangfj csukuangfj restored the js-vad-asr branch July 26, 2024 05:02
@csukuangfj csukuangfj deleted the js-vad-asr branch July 26, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant